public class Main {
    public static void main(String args[]){
            Rational r1 = new Rational(1, 5);
            Rational r2 = new Rational(2, 8);
            Rational r3 = new Rational(1, 6);
            System.out.println(r1 + " + " + r2 + " = " + r1.add(r2));
            System.out.println(r1 + " - " + r2 + " = " + r1.subtract(r2));
            System.out.println(r1 + " * " + r2 + " = " + r1.mulitiply(r2));
            System.out.println(r1 + " / " + r2 + " = " + r1.divide(r2));
            System.out.println(r1 + " + " + r2 + " + " + r3 + " = " + (r1.add(r2)).add(r3));
    }
}

